package event

import heap.EventNotifiable

class EventVMInit(list: List<String>) : Event() {
    companion object {
        const val TYPE = "VMInit"
        const val KEY_HEAP_SIZE = "HeapSize"
    }

    var heapSize: Long = 0

    init {
        heapSize = list.first { it.split('=')[0] == KEY_HEAP_SIZE }.split('=')[1].toLong()
    }

    override fun toString(): String {
        return "EventVMInit(heapSize=$heapSize)"
    }

    override fun notifyTHeap(notifiable: EventNotifiable) {
        notifiable.receiveNotify(this)
    }
}